package com.sakura.probe.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sakura.probe.pojo.Topic;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TopicMapper extends BaseMapper<Topic> {
    /**
     * 分页查询话题
     * @param topicCondition
     * @param rowIndex
     * @param pageSize
     * @return
     */
    List<Topic> queryTopicList(@Param("topicCondition") Topic topicCondition,
                               @Param("rowIndex")int rowIndex,@Param("pageSize") int pageSize);

    /**
     * 返回指定搜索帖子的总数
     * @param topic
     * @return
     */
    Long queryTopicCount(@Param("topicCondition")Topic topic);

    /**
     * 修改话题相关内容
     * @param condition
     * @return
     */
    Long updateTopic(@Param("topic") Topic condition);

    /**
     * 根据话题id删除
     */
    Long deleteTopicById(Long topicId);




}
